Pencil is a vector-oriented drawing program. Its most remarkable feature is that new drawing methods can be added to it in the form of postscript language procedures (even at run-time). However, even if you are unfamiliar with PostScript, Pencil can be quite useful with its built-in set of drawing methods. There are polygons, curves (hermite and bezier), circles, arcs, rectangles (also with rounded corners), character paths, "Rich Text" and so on. You can rotate, scale, group, clip, copy, paste, reorder and move graphics. There are numerous fill types (several gradients) and stroke types (including "neon light" gradient stroke). You can add shadows and other effects to a graphics object. You can print the view or copy it as postscript-code to the clipboard (for use in Edit etc.). You can scroll around and set the scale of the view. There is even a basic freehand tool for drawing polygons. You can send commands to Pencil via Distributed Objects. I have written a program named PencilTCLClient (ptcl, based on tclsh and tcl7.3 by John Ousterhout) to simplify this task.\
\b0 To draw a new graphic, command-click in the white area of the "Pencil"-window to set the first point. Then click&drag to set additional points. After the last point
\i press the right mouse-button
\i0 to exit creation mode.\
Now you can
\b select and move points
\b0 simply by clicking&dragging. When you click in the area covered by the graphic object but not near any of its points, you can move it around. You can drag out a selection by pointing at an empty spot and dragging out a rectangle.\
Use shift-click to do multiple selection. Use Alternate-click to select an object that is below the currently selected one.\
You can cut, copy and paste the current selection. Backspace deletes a graphic object. Use Command-a to select all, Command-Shift-A to deselect all. Command-Shift-F brings the current selection to front, Command-Shift-B sends it to back. (
\b Instance drawing
\b0 is used for the current selection, so it always appears to be in front of all other graphic objects. However, the order will be correct when you deselect it.)\
\b rotate
\b0 a graphic, control-click at the center of rotation, then drag to rotate (You can specify a "baseline" by control-click-dragging first. Then the graphic will be rotated in such a way that the baseline will be transformed into the direction center->current mouse position).\
\b scale
\b0 a graphic, shift-control-click at the center, then drag horizontally to scale. To scale differently in x- and y- directions, shift-control-alternate click.\
\b import EPS/TIFF-images
\b0 use "Edit>Import TIFF/EPS" (Cmd-4). You can rotate and scale them like any other graphics. EPS images are shown as a gray rectangle when moved. (Both TIFF and EPS are not cached, so you can scale them to any size without using up more memory).\
For Pencil, the shape of every graphic object is determined by a number of
\b control points
\b0 which the user creates and moves via the mouse. However, the interpretation of the control points is up to the
\b "Path"-procedure
\b0 , which constructs a postscript path that will be drawn by the
\b "Draw"-procedure
\b0 , which in turn uses the
\b "Fill" and "Stroke"-procedures
\b0 chosen by the user.\
As an example, take the path procedure named "Circle". It uses the first point as the circle's origin and the second one to determine its radius. The user can then choose to have this circle drawn by the "Filled & Stroked"-draw procedure that will apply the "Fill" and "Stroke"-procedures. Or he could try the "3D Effect"-draw procedure. Independently, one could set the "Fill"-procedure to fill the shape with a gradient or the "Stroke"-procedure to draw a dashed line etc. These procedure types can be set in the "Pencil Inspector"-Panel via PopUp-Lists or by entering the postscript procedure names (which are different from the more readable entries in the PopUp-Lists) in textfields. \
>> Open the "
\b PencilOverview.pencil
\b0 "-document in the "
\b ExampleDocuments
\b0 " directory to see all built-in procedure types.\
\b0 (normally fill- and stroke-color, but the interpretation is up to the procedures) and the
\b linewidth
\b0 can be set in the inspector. However, certain procedures need more information. This can be supplied in the
\b "User variable definitions"-field
\b0 in the form of postscript variable definitions like "/shadowgray 0 def" or "/text (Hello) def". These will be executed and the variable values will be used by the procedures. The name and meaning of the variables is different for each procedure. Many procedures use no variables at all, some procedures are really shortcuts to call other procedures with a variable preset to a certain value, and other procedures need variable definitions, otherwise you won't see anything (e. g. "Text" or "Function").\
\b\i Procedure
\i0
\i Example variable definitions and\
explanations\
\i0 \
Grid,\
Horizontal\
Lines,\
Vertical\
Lines
\b0 /gridsize 5 def (default)\
Sphere\
gradients
\b0 /centerR .1 def\
/centerX .4 def\
(default)\
centerR=radius of "highlight" as\
fraction of circle-radius\
centerX=x-coordinate of "highlight"\
as fraction of circle-radius\
\b0 /text (This is the text) def\
/font (Times-Roman) def\
/font (Helvetica) def\
/font (Courier-Bold) def\
/fontsize 100 def\
Function
\b0 /function \{ x 2 exp 2 sub 3 div \} def\
/function \{ x 360 mul sin x add \} def\
(The function has to be a procedure\
that leaves exactly one number on\
the stack and only uses the variable\
'x')\
\b Rounded\
Rectangle
\b0 /csize 10 def (default)\
csize=radius of corners\
\b Shadows
\b0 /shadowgray .2 def (default)\
\b Dashed Lines
\b0 /dashpattern [5 5] def (default)\
/dashpattern [10 3 8 12] def\
Be careful when entering variable definitions
they are executed directly by the DisplayPostScript-server, so syntax errors can be more or less harmful (at worst, the application could quit unexpectedly).\
Read more about writing your own path/ draw/ fill/ stroke- methods in "
\b CustomizingPencil.rtf
\b0 ".\
\b\fs28\gray216\fc2\cf2 KNOWN PROBLEMS
\gray0\fc0\cf0 \
\b0\fs24
When moving or resizing the window, the current selection may get "invisible". This is because Pencil uses "instance drawing" for the current selection. In such a case, either deselect all (Cmd-Shift-A) or click again at the invisible selection. It should become visible again.\
Sometimes you can't move an object's controlpoints although it is selected. This happens when you have drag-selected a multiple selection (even a single object is considered a multiple selection after drag-selection). Deselect all and click (don't drag) at the object.\
There should be a more user-friendly way of setting "user variables".\
Never enter an invalid postscript user-definition that doesn't have the right number of open and closing braces. E. g.\
/text (Very :-( bad) def\
will leave the mouse cursor spinning. (PostScript thinks that everything to the right of "(Very" is a string, because there is one open brace too many)\
PostScript errors aren't caught, they are dumped directly to the console.\
The PostScript-Code generated for printing (or saving to a .ps-file) includes all postscript-procedure definitions (about 15 K) , even when only a small subset of them is actually used. Fixing this would require a kind of "linker" for the postscript definitions.\
There is only one PostScript Context for all documents, so changing a Custom-PostScript definition in one view will affect all other documents as well. Using multiple documents when playing with the "Custom-PostScript" feature can result in confusion.\
\b0 a set of graphic objects: Draw the clippath above the objects you want to clip, bring it to back (Command-Shift-B), select all (Command-a) or drag-select the objects you want to clip including the clippath, group&clip (Command-1), deselect the graphic object (Command-Shift-A).\
When drawing a hermite curve: double-click to insert a "corner" (=point with zero-tangent).\
Remember: Don't forget to press the right mouse button after you have created a graphic object!\
If you have a lot of graphics on the screen and things become slow, use the "
\b Only draw outlines
\b0 "-switch.\
When you have used the freehand tool for polygon-drawing, don't forget to reset the choice to "Rubberband" before trying to draw other graphics objects\
If scrolling becomes slow due to a lot of objects on the screen: use "Only draw outlines" and/or set the factor "Scroll x " to .5 or 1 (thus scrolling half of or the whole page width each time you press a scroll-button)\
When you want to draw a graphic composed of many complicated pieces, use the scrolling feature to draw them in different, non-overlapping areas (so Pencil only has to display one of them at a time) and reassemble them by using the group-command and moving them together.\
When trying to select something apparently selects more than the intended object, you have probably moved the mouse a bit while pressing the mouse button, thus activating the drag-selection feature.\
To create text: Choose "Text", Command-click at the lower-left corner of the designated text area, click right mouse button. The "User variable definitions"-field will have been initialized with a standard text in 32pt Helvetica. Then change these variable definitions to get the string/font/size you want. \
Alternative: Choose "Rich Text" and command-click at the lower-left corner of the text's location. Enter the text. Click somewhere else to end editing. To edit an existing RichText: Double-click on it.\
You can convert a RichText to a CharacterPath by selecting it and choosing "Edit>Convert to CharP" (Cmd-7). Then you will be able to rotate it and apply draw/fill/stroke-methods.\
When pasting more than once: The second copy is placed at exactly the same location as the first one, so move it a bit to reveal the first one.\
Press the spacebar or the return key to paste a graphic which will be centered at the current location of the mouse cursor. (Useful for pasting several instances of an object at different locations)\
You can use the keys '4', '8', '6', '2' to scroll.\
Select Format > Tools to get a panel that allows access to some commands like ToFront, DeletePoint etc.\
Look for PencilTCLClient, a tcl interpreter that can send commands to Pencil (draw & change graphic objects, open, save, create documents) via Distributed Objects.\
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fs16\fc0\cf0 Pencil. (C) 1994, 95 by Florian Marquardt. V1.0. This text was last changed: March 95
%!PS-Adobe-2.0 EPSF-2.0
%%.eps
%%by FM
%%Pages: 0 0
%%BoundingBox: 0 0 150 16
%%EndComments
0 0 .5 setrgbcolor
0 0 150 16 rectfill
3 setlinewidth
/tri { 8 8 rlineto -8 8 rlineto stroke } def
1 setgray
9 0 moveto tri
0 0 .5 setrgbcolor
6 0 moveto tri
1 setgray
3 0 moveto tri
0 0 .5 setrgbcolor
0 0 moveto tri
1 setgray
(Helvetica-Bold) findfont 12 scalefont setfont
20 3 translate 0 0 moveto (DRAWING & EDITING) show
WhatIs.eps
TIPSTRICKS.eps
ContProc.eps
DrawEd.eps
GraphAtt.eps
%!PS-Adobe-2.0 EPSF-2.0
%%.eps
%%by FM
%%Pages: 0 0
%%BoundingBox: 0 0 170 16
%%EndComments
0 0 .5 setrgbcolor
0 0 170 16 rectfill
3 setlinewidth
/tri { 8 8 rlineto -8 8 rlineto stroke } def
1 setgray
9 0 moveto tri
0 0 .5 setrgbcolor
6 0 moveto tri
1 setgray
3 0 moveto tri
0 0 .5 setrgbcolor
0 0 moveto tri
1 setgray
(Helvetica-Bold) findfont 12 scalefont setfont
20 3 translate 0 0 moveto (GRAPHICS ATTRIBUTES) show
[21@]
NXColorWell
Color 1
Helvetica-Bold
Color 2
Linewidth
Rubberband)
OtherViews
Freehand)
PopUpList
popUp:
NXpopup
NXpopupH
User variable definitions:
Helvetica-BoldOblique
Path-method
Draw-method
Fill-method
Stroke-method
To start a new graphic: Command-click, then drag out points, after last point: click right mouse button! To select/move points/ graphics: click&drag. Alt-click to select different graphic. To rotate selected graphic: Ctrl-click at center then drag.W
\pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\f0\b0\i0\ulnone\fs24\fc1\cf1 "Pencil" is Copyright 1994, 95 by Florian Marquardt and may be distributed under the terms of the GNU general public license:\